import SodaCommon from "../soda/SodaCommon";

export const BLOCK_GS_COLOR = {
    PURPLE: 1,
    RED: 2,
    GREEN: 3,
    BLUE: 4,
    YELLOW: 5
}

export const S_CELL_GS_WIDTH = 71;

export const S_CELL_FALL_SPEED = 0.2;

export const GetGameGridCount = () => {
    if (IsSH()) {
        return 10;
    }
    return 8;
}

export const IsSH = () => {
    return SodaCommon.gameReviewStatus === 0;
}

export const GAME_STATE = {
    FALLING: 1,
    WAITTING: 2,
    GATHERING: 4,
    ELIMINATING: 5,
    PROPING: 6,
    OVER: 7,
}

export const PROP_GS_TYPE = {
    HAMMER: 1,
    MAGIC_WAND: 2,
    WINDMILL: 3,
}

export const GAMEMODEGS = {
    DEFAULT: 1,
    CONTINUE: 2, // 从上次退出的地方继续
    BESTSCORE: 3, // 从最高记录开始
}


export const MAX_SCOREGS = 3000;

const LEVEL_FUCK = [
    [
        [1, 1, 1, 1, 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [3, 3, 3, 3, 3, 3, 3, 3],
    ],
    [
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [1, 2, 3, 4, 5, 1, 2, 3],
    ],
    [
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
    ],
    [
        [1, 2, 2, 2, 2, 2, 2, 2],
        [2, 1, 2, 2, 2, 2, 2, 2],
        [2, 2, 1, 2, 2, 2, 2, 1],
        [2, 2, 2, 1, 2, 2, 1, 2],
        [2, 2, 2, 2, 1, 1, 2, 2],
        [2, 2, 2, 2, 1, 1, 2, 2],
        [2, 2, 2, 1, 2, 2, 1, 2],
        [2, 2, 1, 2, 2, 2, 2, 1],
    ],
    [
        [1, 2, 3, 2, 2, 2, 2, 3],
        [2, 1, 3, 2, 2, 2, 2, 3],
        [2, 2, 1, 2, 2, 2, 2, 1],
        [2, 2, 3, 1, 2, 2, 1, 3],
        [2, 2, 3, 2, 1, 1, 2, 3],
        [2, 2, 3, 2, 1, 1, 2, 3],
        [2, 2, 3, 1, 2, 2, 1, 3],
        [2, 2, 1, 2, 2, 2, 2, 1],
    ],
    [
        [1, 2, 1, 2, 1, 2, 1, 2],
        [2, 3, 2, 3, 2, 3, 2, 3],
        [3, 4, 3, 4, 3, 4, 3, 4],
        [4, 5, 4, 5, 4, 5, 4, 5],
        [5, 1, 5, 1, 5, 1, 5, 1],
        [5, 1, 5, 1, 5, 1, 5, 1],
        [4, 5, 4, 5, 4, 5, 4, 5],
        [3, 4, 3, 4, 3, 4, 3, 4],
    ],
    [
        [1, 1, 2, 2, 3, 3, 4, 4],
        [1, 1, 2, 2, 3, 3, 4, 4],
        [5, 5, 4, 4, 3, 3, 2, 2],
        [5, 5, 4, 4, 3, 3, 2, 2],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [1, 2, 3, 4, 5, 5, 4, 3],
        [5, 4, 3, 2, 1, 1, 2, 3],
        [5, 4, 3, 2, 1, 1, 2, 3],
    ],
    [
        [2, 2, 3, 4, 5, 1, 2, 3],
        [2, 3, 4, 5, 1, 2, 3, 4],
        [3, 4, 5, 1, 2, 3, 4, 5],
        [4, 5, 1, 2, 3, 4, 5, 1],
        [5, 1, 2, 3, 4, 5, 1, 2],
        [1, 2, 3, 4, 5, 1, 2, 3],
        [2, 3, 4, 5, 1, 2, 3, 4],
        [3, 4, 5, 1, 2, 3, 4, 5],
    ],
]

const LEVEL_FUCK_TEN = [
    [
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
    ],
    [
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
    ],
    [
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
    ],
    [
        [1, 2, 2, 2, 2, 2, 2, 2, 2, 1],
        [2, 1, 2, 2, 2, 2, 2, 2, 1, 2],
        [2, 2, 1, 2, 2, 2, 2, 1, 2, 2],
        [2, 2, 2, 1, 2, 2, 1, 2, 2, 2],
        [2, 2, 2, 2, 1, 1, 2, 2, 2, 2],
        [2, 2, 2, 2, 1, 1, 2, 2, 2, 2],
        [2, 2, 2, 1, 2, 2, 1, 2, 2, 2],
        [2, 2, 1, 2, 2, 2, 2, 1, 2, 2],
        [2, 1, 2, 2, 2, 2, 2, 2, 1, 2],
        [1, 2, 2, 2, 2, 2, 2, 2, 2, 1],
    ],
    [
        [1, 2, 3, 2, 2, 2, 2, 3, 2, 1],
        [2, 1, 3, 2, 2, 2, 2, 3, 1, 2],
        [2, 2, 1, 2, 2, 2, 2, 1, 2, 2],
        [2, 2, 3, 1, 2, 2, 1, 3, 2, 2],
        [2, 2, 3, 2, 1, 1, 2, 3, 2, 2],
        [2, 2, 3, 2, 1, 1, 2, 3, 2, 2],
        [2, 2, 3, 1, 2, 2, 1, 3, 2, 2],
        [2, 2, 1, 2, 2, 2, 2, 1, 2, 2],
        [2, 1, 3, 2, 2, 2, 2, 3, 1, 2],
        [1, 2, 3, 2, 2, 2, 2, 3, 2, 1],
    ],
    [
        [1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
        [2, 3, 2, 3, 2, 3, 2, 3, 2, 3],
        [3, 4, 3, 4, 3, 4, 3, 4, 3, 4],
        [4, 5, 4, 5, 4, 5, 4, 5, 4, 5],
        [5, 1, 5, 1, 5, 1, 5, 1, 5, 1],
        [5, 1, 5, 1, 5, 1, 5, 1, 5, 1],
        [4, 5, 4, 5, 4, 5, 4, 5, 4, 5],
        [3, 4, 3, 4, 3, 4, 3, 4, 3, 4],
        [2, 3, 2, 3, 2, 3, 2, 3, 2, 3],
        [1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
    ],
    [
        [1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
        [1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
        [5, 5, 4, 4, 3, 3, 2, 2, 1, 1],
        [5, 5, 4, 4, 3, 3, 2, 2, 1, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [1, 2, 3, 4, 5, 5, 4, 3, 2, 1],
        [5, 4, 3, 2, 1, 1, 2, 3, 4, 5],
        [5, 4, 3, 2, 1, 1, 2, 3, 4, 5],
        [2, 3, 2, 3, 2, 3, 2, 3, 2, 3],
        [1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
    ],
    [
        [2, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [2, 3, 4, 5, 1, 2, 3, 4, 5, 1],
        [3, 4, 5, 1, 2, 3, 4, 5, 1, 2],
        [4, 5, 1, 2, 3, 4, 5, 1, 2, 3],
        [5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
        [1, 2, 3, 4, 5, 1, 2, 3, 4, 5],
        [2, 3, 4, 5, 1, 2, 3, 4, 5, 1],
        [3, 4, 5, 1, 2, 3, 4, 5, 1, 2],
        [4, 5, 1, 2, 3, 4, 5, 1, 2, 3],
        [5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
    ]
]

export const GetSurpriseLevelgs = () => {
    if (IsSH()) {
        return LEVEL_FUCK_TEN;
    }
    return LEVEL_FUCK;
}

export const GetOnecolorgsLevel = () => {
    if (IsSH()) {
        return LEVEL_FUCK_TWO_TEN;
    }
    return LEVEL_FUCK_TWO;
}

const LEVEL_FUCK_TWO = [
    [
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1],
    ],
    [
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2],
    ],
    [
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3],
    ],
    [
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4],
    ],
    [
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5],
    ],
]

const LEVEL_FUCK_TWO_TEN = [
    [
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    ],
    [
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
    ],
    [
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
    ],
    [
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
        [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
    ],
    [
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
        [5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
    ]
]